<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="">
    <meta http-equiv="x-dns-prefetch-control" content="on">

    <title>系统消息</title>
    <link href="../../css/css.css" rel="stylesheet" type="text/css">
    <script src="../../js/jquery-v1.11.2.min.js"></script>
    <script src="../../js/driver.js"></script>
    <script src="../../js/common.js"></script>
</head>
<body>
<section class="commission-area">
    <label class="commission-number">系统消息</label>
</section>
<section class="subtitle p15 mt164 p15r">
    本月消息:<span class="red" id="getMessageMonth">0</span>(条)
    <i class="iconfont rightsmallicon">&#xe6d8;</i>
    <label class="right" id="monthShow">2017/05</label>
    <!--月份筛选-->
    <div class="customer_popuparea">
        <div class="dropbox" id="dropbox">
            <div class="dropitem">2017年5月<i class="iconfont rightsmallicon_red">&#xe6da;</i></div>
        </div>
    </div>
    <!--END-->
</section>
<section class="itemgroup p15 mb56" id="capitalListHtmlId">
	<div class="twoitem">
        <label class="itemname">
            测试推送消息显示
            <span class="green right">+0</span>
        </label>
        <label class="itemsubname">2017/4/5 12:59:59</label>
    </div>
</section>
<script type="text/javascript">
    $(function () {
        //token验证
        checkDriverToken();
    });
   
    var monthDate = GetArgsFromHref("monthDate");
    $(function () {
        
        var url = _global.serverHost + "/capital/driver/messageList.htm";
        var data = {monthDate: monthDate, driverUuid: getCookie("driverUuid")};
        _callAjaxRequest(url, data, startBidBack);


        function startBidBack(data) {
            $("#getMessageTotalMonth").html(data.totalMessage.totalNum);
            $("#getMessageMonth").html(data.totalMessage.totalNum);
            $("#monthShow").html(data.queryMap.monthDate);

            var dropbox = "";
            for (var a = 0; a < data.monthList.length; a++) {
                var selected_css = '';
                if (data.queryMap.monthDate == data.monthList[a].monthDateId) selected_css = '<i class="iconfont rightsmallicon_red">&#xe6da;</i>';
                dropbox = dropbox + '<div class="dropitem" onclick="monthCapital(\'' + data.monthList[a].monthDateId + '\')">' +
                        data.monthList[a].monthDate + selected_css + '</div>';
            }
            $(".customer_popuparea").toggle();
            $("#dropbox").html(dropbox);

            var twoitem = "";
            for (var i = 0; i < data.messageList.length; i++) {
                twoitem = twoitem + '<div class="twoitem"><label class="itemname">' + data.messageList[i].message + "</span></label>" +
                        "<label class=\"itemsubname\">" + data.messageList[i].createDate + "</label></div>";
            }
            $(".twoitem").html(twoitem);
        }
    })

    function monthCapital(monthDateId) {
        window.location.href = "../wallet/message.html?monthDate=" + monthDateId;
    }

    $("#monthShow").click(function () {
        $(".customer_popuparea").toggle();
    });
    
</script>
</body>
</html>